package com.king01.controller;

import com.king01.entity.Staff;
import com.king01.service.GoodsService;
import com.king01.service.HomeService;
import com.king01.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ：lqs
 * @date ：Created in 2023/10/11 14:24
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/home")
public class HomeController {

    @Autowired
    private HomeService homeService;


    @RequestMapping("/head1")
    public Result head1(){
        Result staffname = homeService.findStaffname();
        return staffname;
    }
    @RequestMapping("/head2")
    public Result head2(){
        Result branchname = homeService.findBranchname();
        return branchname;
    }
    @RequestMapping("/branchcount")
    public Result branchcount(){
        Result branchname = homeService.branchcount();
        return branchname;
    }
    @RequestMapping("/staffcount")
    public Result staffcount(){
        Result staffcount = homeService.staffcount();
        return staffcount;
    }
    @RequestMapping("/goodcount")
    public Result goodcount(){
        Result branchname = homeService.goodcount();
        return branchname;
    }
    @RequestMapping("/goodprice")
    public Result goodprice(){
        Result result = homeService.findGoods();
        return result;
    }
    @RequestMapping("/dept")
    public Result dept(){
        Result result = homeService.findDept();
        return result;
    }
    @RequestMapping("/goods")
    public Result goods(){
        Result result = homeService.Goods();
        return result;
    }
    @RequestMapping("/jbxx")
    public Result jbxx(){
        Result result = homeService.jbxx();
        return result;
    }
    @RequestMapping("/updatemima")
    public Result updatemima(Integer currentPassword,Integer newPassword){
        Result result = homeService.updatemima(currentPassword,newPassword);
        return result;
    }

    @RequestMapping("/upload")
    public Result upload(MultipartFile headUrl){
        Result result = homeService.upload(headUrl);
        return result;
    }



}

